const path = require('path')
const fs = require('fs')
const moment = require('moment')

module.exports = (err) => {
    let logFilePath = path.join(__dirname, '../', 'logs', moment().format('YYYY-MM-DD') + '.log')
    let data = fs.readFileSync(logFilePath, 'utf-8')
    data = data.replace(/ok$/, err)
    fs.writeFileSync(logFilePath, data)
}